﻿Jxstar.currentPage = function() {
	var config = {param:{},initpage:function(page, define){},eventcfg:{}};
	
	var auditData = Jxstar.findComboData('audit');
	var moneytypeData = Jxstar.findComboData('moneytype');
	var items = [{
		height: '97%',
		width: '97%',
		border: false,
		layout: 'form',
		style: 'padding:10px;',
		items: [{
			anchor:'100%',
			border: false,
			layout:'column',
			autoHeight:true,
			items:[{
				border:false,
				columnWidth:0.495,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'textfield', fieldLabel:'采购单号', name:'pur_say_record__apply_code', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'textfield', fieldLabel:'项目名称', name:'pur_say_record__project_name', readOnly:true, anchor:'100%', maxLength:100},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'预算金额(万元)', name:'pur_say_record__project_money', readOnly:true, anchor:'100%', maxLength:12},
					{xtype:'textfield', fieldLabel:'实施单位', name:'pur_say_record__dept_name', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'textfield', fieldLabel:'主管部门', name:'pur_say_record__done_deptname', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'datefield', fieldLabel:'谈判时间', name:'pur_say_record__say_time', defaultval:'fun_getToday()', format:'Y-m-d', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', anchor:'100%'},
					{xtype:'textfield', fieldLabel:'登记人', name:'pur_say_record__result_user', defaultval:'fun_getUserName()', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', anchor:'100%', maxLength:50},
					{xtype:'hidden', fieldLabel:'授权形式', name:'pur_say_record__auth_type', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'选中供应商ID', name:'pur_say_record__provider_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'项目ID', name:'pur_say_record__project_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'主键', name:'pur_say_record__record_id', anchor:'100%'}
				]
			},{
				border:false,
				columnWidth:0.495,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'combo', fieldLabel:'记录状态', name:'pur_say_record__auditing', defaultval:'0',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: auditData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: auditData[0][0]},
					{xtype:'textfield', fieldLabel:'项目编号', name:'pur_say_record__project_code', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'combo', fieldLabel:'项目类别', name:'pur_say_record__money_type',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: moneytypeData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: moneytypeData[0][0]},
					{xtype:'textfield', fieldLabel:'项目批复文号', name:'pur_say_record__check_fileno', readOnly:true, anchor:'100%', maxLength:100},
					{xtype:'textfield', fieldLabel:'项目负责人', name:'pur_say_record__project_user', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'textfield', fieldLabel:'谈判地点', name:'pur_say_record__say_address', anchor:'100%', maxLength:50},
					{xtype:'trigger', fieldLabel:'选中供应商', name:'pur_say_record__provider_name',
						anchor:'100%', triggerClass:'x-form-search-trigger',
						maxLength:50, allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', editable:false,
						onTriggerClick: function() {
							var selcfg = {pageType:'combogrid', nodeId:'provider_select', layoutPage:'', sourceField:'provider.provider_name;provider_id', targetField:'pur_say_record.provider_name;provider_id', whereSql:"manage_status = '20'", whereValue:'', whereType:'', isSame:'0', isShowData:'1', isMoreSelect:'0',isReadonly:'1',fieldName:'pur_say_record.provider_name'};
							JxSelect.createSelectWin(selcfg, this, 'node_pur_say_record_form');
						}},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'中标金额(万元)', name:'pur_say_record__bid_money', defaultval:'0', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', anchor:'100%', maxLength:12},
					{xtype:'hidden', fieldLabel:'项目负责人ID', name:'pur_say_record__project_userid', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'主管部门ID', name:'pur_say_record__done_deptid', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'采购单ID', name:'pur_say_record__apply_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'实施单位ID', name:'pur_say_record__dept_id', anchor:'100%'}
				]
			}
			]
		},{
			anchor:'100%',
			border: false,
			layout:'column',
			autoHeight:true,
			items:[{
				border:false,
				columnWidth:0.99,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'textarea', fieldLabel:'公司谈判小组成员', name:'pur_say_record__join_person', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', width:'100%', height:48, maxLength:200},
					{xtype:'textarea', fieldLabel:'监督小组', name:'pur_say_record__sup_group', width:'100%', height:48, maxLength:200},
					{xtype:'textarea', fieldLabel:'第一家供应商谈判情况记录', name:'pur_say_record__first_sayred', width:'100%', height:48, maxLength:200},
					{xtype:'textarea', fieldLabel:'第二家供应商谈判情况记录', name:'pur_say_record__second_sayred', width:'100%', height:48, maxLength:200},
					{xtype:'textarea', fieldLabel:'第三家供应商谈判情况记录', name:'pur_say_record__third_sayred', width:'100%', height:48, maxLength:200},
					{xtype:'textarea', fieldLabel:'第四家供应商谈判情况记录', name:'pur_say_record__fourth_sayred', width:'100%', height:48, maxLength:200},
					{xtype:'textarea', fieldLabel:'谈判结论', name:'pur_say_record__say_result', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', width:'100%', height:48, maxLength:200}
				]
			}
			]
		}]
	}];
	
	config.param = {
		items: items,
		funid: 'pur_say_record'
	};

	config.eventcfg = {		//初始化页面数据		initOther : function() {			var myform = this.form;						var say_time = myform.get('pur_say_record__say_time');			var result_user = myform.get('pur_say_record__result_user');						if (say_time == null || say_time.length == 0) {				myform.set("pur_say_record__say_time", JxDefault.getToday());			}			if (result_user == null || result_user.length == 0) {				myform.set("pur_say_record__result_user", JxDefault.getUserName());			}					}		};
	
	return new Jxstar.FormNode(config);
}